<?php
class Util extends CI_Model {

    public function __construct()
    {
		$this->load->model('SessionManager');
        //$this->load->database();
    }
	//  status(状态码，成功1，失败0) errorcode(错误码，status=0有效) message() data(数据)  
	public function format_return($status,$errorcode,$message,$data='')
	{
		$data=array('status'=>$status,'code'=>$errorcode,'msg'=>$message,'data'=>$data);
		return $data;
	}
	
	public function get_times_moring(){
		$y = date("Y");
		$m = date("m");
		$d = date("d");
		$time=mktime(0,0,0,$m,$d,$y);
		return $time;
	}
	public function get_tomorrow_moring(){
		$y = date("Y");
		$m = date("m");
		$d = date("d");
		$time=mktime(23,59,59,$m,$d,$y)+1;
		return $time;
	}
	public function get_yesterday_moring(){
		$y = date("Y");
		$m = date("m");
		$d = date("d");
		$time=mktime(-23,-59,-59,$m,$d,$y)-1;
		return $time;
	}
}